<template>
	<gui-page class="container">
		<view slot="gBody" class="content">
			<view class="gui-flex gui-justify-content-end gui-align-items-center">
				<view class="bnt-save" @click="getData">
					刷新
				</view>
			</view>
			
			<gui-slide-list :msgs="speakerMsgs" ></gui-slide-list>
		</view>
	</gui-page>
</template>

<script>
	import state from "@/config";
	export default {
		name: "index",
		data() {
			return {
				isLogin: !!state.isLogin(),
				speakerMsgs: [],
			};
		},
		onShow() {},
		onLoad() {
			this.getData();
		},
		methods: {
			getData() {
				uni.showLoading({
					title: "加载中",
				});
				//   this.$api.courseList({}, (e) => {
				// e = e || {};
				let e = {
					records: [{
						id: 1,
						title: "公告123发发士大夫额发的"
					},
					{
						id: 2,
						title: "公告123发发士大夫额发的"
					},
					{
						id: 3,
						title: "公告123发发士大夫额发的"
					},
					{
						id: 4,
						title: "公告123发发士大夫额发的"
					},
				],
				};
				uni.hideLoading();
				let demoArr = e.records || [];
				if (this.pageNum >= 2) {
					this.speakerMsgs = this.speakerMsgs.concat(demoArr);
				} else {
					this.speakerMsgs = [];
					this.speakerMsgs = demoArr;
				}
				//   });
				this.isRefresher = false;
			},
		},
	};
</script>

<style scoped lang="less">
	.container {
		width: 100%;
		min-height: 100vh;
		background: url() no-repeat top right,
			url() no-repeat bottom left;
		background-color: #f9f9f9;
		max-width: 750rpx;
		margin: 0 auto;
		.content{
			padding: 20rpx;
		}
		.bnt-save {
			background-color: #1c2d66;
			color: #ffffff;
			font-size: 26rpx;
			padding: 10rpx 30rpx;
			border-radius: 10rpx;
		}
	}
</style>